
<%@ page import="java.util.List" %>
<%@ page import="domain.model.requestInvite.RequestInvite" %>
<%@ page import="domain.model.group.Group" %>
<%@ page import="domain.model.group.IGroup" %>
<%@ page import="domain.model.group.mapper.GroupInputMapper" %>
<%@ page import="domain.model.user.User" %>   
<%@ page import="domain.model.user.IUser" %> 
<%@ page import="domain.model.user.mapper.UserInputMapper" %> 


<h2> ${title} </h2>
<p>View Request Information below: </p>

<div id="queryContents">

		<table border="1" style="border-collapse: collapse;">
			<tr>
				<th>User Name</th>
				<th>Accept Request</th>
				<th>Decline Request</th>
			</tr>
			<%
				List<RequestInvite> requests = (List<RequestInvite>)request.getAttribute("requestList");
				for(RequestInvite requestI: requests)
				{
					User u = UserInputMapper.find(requestI.getUser().getId());
					
			%>
				<tr>
			 		<td>
			 			<a href="" onclick="showUser(<%=u.getId()%>); return false;" ><%=u.getFirstName()%></a>
						<div id="user_box_<%=u.getId()%>" style="display: none; text-align:left;">
							<br />
								- <%=u.getFirstName()%> <%=u.getLastName()%><br />
						</div>
					</td>
					<td><a href="AcceptDecline?accepted=true&userid=<%=u.getId()%>&requestInviteversion=<%=requestI.getVersion()%>"><button>Accept</button> </a> </td>
					<td><a href="AcceptDecline?accepted=false&userid=<%=u.getId()%>&requestInviteversion=<%=requestI.getVersion()%>"><button>Decline</button> </a> </td>
				</tr>
			<%
				}
			%>
		</table>
</div> <!--closing queryContents -->
